    <!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <th:block th:include="include :: header('新增注册备案基本信息')"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="favicon.ico">
    <link rel="stylesheet" href="../../../static/css/bootstrap.min.css" >
    <link rel="stylesheet" href="../../../static/udi/dist/css/layui.css">
    <link href="../../../static/css/font-awesome.min.css" rel="stylesheet"/>
    <!-- bootstrap-table 表格插件样式 -->
    <link href="../../../static/css/animate.css" rel="stylesheet"/>
    <link href="../../../static/css/style.css" rel="stylesheet"/>
    <link href="../../../static/udi/css/jt-ui.css" rel="stylesheet"/>
</head>
<body>
<div class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form id="form-zhuce-add" class="form-horizontal m" th:object="${BaseCorpVo}">
            <input id="id" name="id" type="hidden" th:field="*{id}"/>
            <div class="form-group">
                <label class="col-sm-2 control-label is-required">企业名称：</label>
                <div class="col-sm-10">
                    <select class="form-control" name="deptId" id="deptName" required>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label is-required">注册/备案号：</label>
                <div class="col-sm-4">
                    <input class="form-control" type="text" autocomplete="off" name="zcbah" id="zcbah" th:field="*{zcbah}" required>
                </div>
                <label class="col-sm-2 control-label is-required">注册/备案产品名称：</label>
                <div class="col-sm-4">
                    <input class="form-control" type="text" autocomplete="off" name="zcbacpmc" id="zcbacpmc" th:field="*{zcbacpmc}" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">医疗器械管理类别：</label>
                <div class="col-sm-4">
                    <input class="form-control" type="text" autocomplete="off" name="ylqxgllb" id="ylqxgllb" th:field="*{ylqxgllb}">
                </div>
                <label class="col-sm-2 control-label is-required">注册人/备案人：</label>
                <div class="col-sm-4">
                    <input class="form-control" type="text" autocomplete="off" name="zcbar" id="zcbar" th:field="*{zcbar}" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">器械类别：</label>
                <div class="col-sm-4">
                    <input class="form-control" type="text" autocomplete="off" name="qxlb" th:field="*{qxlb}" id="qxlb">
                </div>
                <label class="col-sm-2 control-label">分类编码：</label>
                <div class="col-sm-4">
                    <input class="form-control" type="text" autocomplete="off" name="flbm" th:field="*{flbm}" id="flbm">
                </div>
            </div>
            <div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">规格型号：</label>
                <div class="col-sm-10">
                    <textarea rows="3" class="form-control" type="text" autocomplete="off" name="ggxh" id="ggxh" th:field="*{ggxh}"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label is-required">批准日期：</label>
                <div class="col-sm-4">
                    <input class="form-control" type="text" autocomplete="off" name="pzTime" id="pzTime" th:value="${#dates.format(BaseCorpVo.pzTime,'yyyy-MM-dd HH:mm:ss')}" required>
                </div>
                <label class="col-sm-2 control-label is-required">退市日期：</label>
                <div class="col-sm-4">
                    <input class="form-control" type="text" autocomplete="off" name="yxTime" id="yxTime" th:value="${#dates.format(BaseCorpVo.yxTime,'yyyy-MM-dd HH:mm:ss')}" required>
                </div>
            </div>
        </form>
    </div>
</div>

<th:block th:include="include :: footer" />
<script src="../../../static/js/jquery.min.js"></script>
<script src="../../../static/js/bootstrap.min.js"></script>
<script src="../../../static/udi/dist/layui.js"></script>
<script src="../../../static/ajax/libs/blockUI/jquery.blockUI.js"></script>
<script src="../../../static/udi/js/common.js"></script>
<script src="../../../static/udi/js/jt-ui.js"></script>
<script th:inline="javascript">
    var init_deptName = [[${BaseCorpVo.deptName}]];
    var init_deptId = [[${BaseCorpVo.deptId}]];
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        laydate.render({
            elem: '#pzTime',
            type:"datetime"
        });
        laydate.render({
            elem: '#yxTime' ,
            type:"datetime"
        });
    });

    $(function () {
        $.ajax({
            url:"/base/getdept",
            type:"get",
            dataType:"json",
            success:function (res){
                $("#deptName").empty();
                $("#deptName").append('<option value="'+init_deptId+'">'+init_deptName+'</option>');
                $.each(res,function (i,o) {
                    if(o.deptName !==init_deptName){
                        $("#deptName").append('<option value="'+o.deptId+'">'+o.deptName+'</option>');
                    }
                })
            }
        })
        $("#form-zhuce-add").validate({
            onkeyup: false,
            rules:{
                zcbah:{
                    remote: {
                        url: "/base/checkZcbahUnique",
                        type: "post",
                        dataType: "json",
                        data: {
                            "id": function() {
                                return $("input[name='id']").val();
                            },
                            "zcbah" : function() {
                                return $.common.trim($("#zcbah").val());
                            }
                        },
                        dataFilter: function(data, type) {
                            return $.validate.unique(data);
                        }
                    }
                },
                zcbacpmc:{
                    remote: {
                        url: "/base/checkZcbacpmcUnique",
                        type: "post",
                        dataType: "json",
                        data: {
                            "id": function() {
                                return $("input[name='id']").val();
                            },
                            "zcbacpmc" : function() {
                                return $.common.trim($("#zcbacpmc").val());
                            }
                        },
                        dataFilter: function(data, type) {
                            return $.validate.unique(data);
                        }
                    }
                },
            },
            messages: {
                "zcbah": {
                    remote: "注册备案号已经存在"
                },
                "zcbacpmc": {
                    remote: "名称已经存在"
                }
            },
            focusCleanup: true
        });
    })
    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save("/base/zcba_edit", $('#form-zhuce-add').serialize());
        }
    }
</script>
</body>
</html>